import urllib.request
import urllib.error
url = "https://blog.csdn.net/hhladminhhl/article/details/120316789"

headers = {
    'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.107 Safari/537.36'
}
request = urllib.request.Request(url=url, headers=headers)

try:
    response = urllib.request.urlopen(request)
    content = response.read().decode("utf-8")
    print(content)
except urllib.error.HTTPError:
    print("系统正在维护中。。。")
except urllib.error.URLError:
    print("链接输入错误")